FROM golang:1.21.7-alpine3.19 as base

RUN apk add git g++ tzdata

WORKDIR /build-app
COPY go.mod  go.sum ./

RUN go mod download

COPY . .
RUN go build -o /build-app/binary-app ./cmd/lbs/

FROM alpine:3.19
WORKDIR /go/bin
COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=base /build-app/binary-app .
ENTRYPOINT [ "./binary-app"]
